const common = {
	setAttribute: function(key, value) {
		sessionStorage.setItem(key, JSON.stringify(value));
	},
	getAttribute: function(key) {
		return JSON.parse(sessionStorage.getItem(key));
	},
	isEmptyString: function(target) {
		if (target) {
			if (target.length > 0) {
				return false;
			}
		}
		return true;
	},
	toJson: (object) => {
		return JSON.stringify(object);
	},
	toObject: (valString) => {
		return JSON.parse(valString);
	},
	deepClone: (object) => {
		return common.toObject(common.toJson(object));
	},
	compareObjectDeep: (val1, val2) => {
		return common.toJson(val1) === common.toJson(val2);
	}
};

export default common;